package com.hp;

import java.util.HashMap;

import static com.sun.xml.internal.fastinfoset.util.ValueArray.MAXIMUM_CAPACITY;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            System.out.println(i % 4);
            System.out.println(i & 3);
            //System.out.println(tableSizeFor(i));
            System.out.println("------------");
            HashMap map = new HashMap();

        }
    }


    /**
     * Returns a power of two size for the given target capacity.
     */
    static final int tableSizeFor(int cap) {
        int n = cap - 1;
        n |= n >>> 1;
        n |= n >>> 2;
        n |= n >>> 4;
        n |= n >>> 8;
        n |= n >>> 16;
        return (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
    }

}
